<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Reranker Framework (ReFr): reranker::FeatureVector&lt; K, V, Map &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Reranker Framework (ReFr)
   
   </div>
   <div id="projectbrief">Reranking framework for structure prediction and discriminative language modeling</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacereranker.html">reranker</a>      </li>
      <li class="navelem"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">reranker::FeatureVector&lt; K, V, Map &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="reranker::FeatureVector" -->
<p>A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.  
 <a href="classreranker_1_1_feature_vector.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>&gt;</code></p>

<p><a href="classreranker_1_1_feature_vector-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef K&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ad77b756f443ca3cd938369dd0a5b617c">key_type</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of vector component/feature uid's in this vector.  <a href="#ad77b756f443ca3cd938369dd0a5b617c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#af1d4a320e7577f785791e5df70391264">mapped_type</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of values/feature weights in this vector.  <a href="#af1d4a320e7577f785791e5df70391264"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef Map&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#acf6076a07743206afbc35acf99a8f2df">FeatureMap</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The underlying type that this class stores the mapping of feature uid's to their weights.  <a href="#acf6076a07743206afbc35acf99a8f2df"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef FeatureMap::const_iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of const iterator for the feature-weight pairs in this vector.  <a href="#a8dc4093ae778bffb30d2840002f02ba1"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a038fac9f5a5d1bcfe98640eff66ba30c">FeatureVector</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an empty feature vector.  <a href="#a038fac9f5a5d1bcfe98640eff66ba30c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a243fcd766c91f24bd79cbb6fb3aabe05">FeatureVector</a> (const Map &amp;features)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy features from the type of map used internally.  <a href="#a243fcd766c91f24bd79cbb6fb3aabe05"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename MapType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a299eb15548226ffe246a2fcdf78804d6">FeatureVector</a> (const MapType &amp;features)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy features from any map, or any collection of (feature,value) pairs, for that matter.  <a href="#a299eb15548226ffe246a2fcdf78804d6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ae57362e810f7cf109f9c96153c387864">~FeatureVector</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ae0c185e646996daff25fcad9b224eda5">begin</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a const iterator pointing to the first of the feature-value pairs of this feature vector.  <a href="#ae0c185e646996daff25fcad9b224eda5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a9f2539faf4e600c2f75b613763d49fcd">end</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a const iterator pointing to the end of the feature-value pairs of this feature vector.  <a href="#a9f2539faf4e600c2f75b613763d49fcd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unordered_set&lt; K &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a87bccd3acb055b98a674e6ed7d29af4b">GetNonZeroFeatures</a> (unordered_set&lt; K &gt; &amp;set) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts the uid's of features with non-zero weights into the specified set.  <a href="#a87bccd3acb055b98a674e6ed7d29af4b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unordered_set&lt; K &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ae4e7570b1829aa527fb6a487016437f0">RemoveNonZeroFeatures</a> (unordered_set&lt; K &gt; &amp;set) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the uid's of features with non-zero weights from the specified set.  <a href="#ae4e7570b1829aa527fb6a487016437f0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unordered_set&lt; K &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a56cdaf41599879784f9342e6d94250b0">RemoveEqualFeatures</a> (const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;other, unordered_set&lt; K &gt; &amp;set) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes from the specified set the uid's of feature with weights equal in this vector to their weights in the specified vector.  <a href="#a56cdaf41599879784f9342e6d94250b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a0786ae9b9f6b579a80d8ae601edfd80a">GetWeight</a> (const K &amp;uid) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the weight of the feature with the specified uid, where crucially features not "present" in this vector implicitly have a weight of 0.0 (or whatever the default constructor of the value type is).  <a href="#a0786ae9b9f6b579a80d8ae601edfd80a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a565133f9b5b31de43d07aea909631be5">GetValue</a> (const K &amp;uid) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Synonymous with <a class="el" href="classreranker_1_1_feature_vector.html#a0786ae9b9f6b579a80d8ae601edfd80a">GetWeight</a>.  <a href="#a565133f9b5b31de43d07aea909631be5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a08a5b65bae6cc0bb35e035e5797a00f2">size</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of non-zero feature components of this feature vector.  <a href="#a08a5b65bae6cc0bb35e035e5797a00f2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a72b41f295541c52d9ad4a25e789b7ba4">empty</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a03929c2f26faf01b1406074943f99b86">Dot</a> (const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;other) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the dot product of this feature vector with the specified <a class="el" href="classreranker_1_1_feature_vector.html" title="A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.">FeatureVector</a>.  <a href="#a03929c2f26faf01b1406074943f99b86"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a541f26184a4407f62eb5dad8102cf375">IncrementWeight</a> (const K &amp;uid, V by)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the weight of the specified feature by the specified amount.  <a href="#a541f26184a4407f62eb5dad8102cf375"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a2829655419a2dfd5014094e6834836df">IncrementValue</a> (const K &amp;uid, V by)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the value of the specified vector component by the specified amount.  <a href="#a2829655419a2dfd5014094e6834836df"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ad94d388ef81023981d6924a2020268d2">SetWeight</a> (const K &amp;uid, V new_weight)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the weight of the specified feature to the specified value.  <a href="#ad94d388ef81023981d6924a2020268d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ac0a4fceef14eba9efb471f5ec0476579">SetValue</a> (const K &amp;uid, V new_value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Synonym for <a class="el" href="classreranker_1_1_feature_vector.html#ad94d388ef81023981d6924a2020268d2">SetWeight</a>.  <a href="#ac0a4fceef14eba9efb471f5ec0476579"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a0535e2a994950ccd367a47fde39faa98">Scale</a> (V scalar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplies this vector, in situ, by the specified scalar.  <a href="#a0535e2a994950ccd367a47fde39faa98"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a76c6244a176999e72a54c78726ee718f">AddScaledVector</a> (const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;other, V scalar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Modifies this vector so that it equals this vector plus the scaled specified vector.  <a href="#a76c6244a176999e72a54c78726ee718f"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename Collection &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#aa732c2a9d4b249b652f881eb57112e1f">AddScaledSubvector</a> (const Collection &amp;feature_uids, const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;feature_vector, V scalar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Modifies this vector so that it equals this vector plus the scaled specified subvector.  <a href="#aa732c2a9d4b249b652f881eb57112e1f"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename Collection &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#afb07b55b5c08d60b2390c20b12ba1a57">IncrementWeights</a> (const Collection &amp;feature_uids, V increment)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the weights for the specified collection of features.  <a href="#afb07b55b5c08d60b2390c20b12ba1a57"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#a7082611256f0b6dc90ba4b38cc43e4ab">clear</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets all feature weights to zero and, because this is a sparse vector, clears all storage.  <a href="#a7082611256f0b6dc90ba4b38cc43e4ab"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_feature_vector.html#ab17a2e88eac7592792ebdb62b731426b">operator&lt;&lt;</a> (ostream &amp;os, const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;fv)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt;<br/>
class reranker::FeatureVector&lt; K, V, Map &gt;</h3>

<p>A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type. </p>
<dl class=""><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">K</td><td>the type to represent unique identifiers for each feature </td></tr>
    <tr><td class="paramname">V</td><td>the value or weight of a feature in this vector </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00091">91</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>
</div><hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="a8dc4093ae778bffb30d2840002f02ba1"></a><!-- doxytag: member="reranker::FeatureVector::const_iterator" ref="a8dc4093ae778bffb30d2840002f02ba1" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef FeatureMap::const_iterator <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of const iterator for the feature-weight pairs in this vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00129">129</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="acf6076a07743206afbc35acf99a8f2df"></a><!-- doxytag: member="reranker::FeatureVector::FeatureMap" ref="acf6076a07743206afbc35acf99a8f2df" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef Map <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#acf6076a07743206afbc35acf99a8f2df">FeatureMap</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The underlying type that this class stores the mapping of feature uid's to their weights. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00127">127</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ad77b756f443ca3cd938369dd0a5b617c"></a><!-- doxytag: member="reranker::FeatureVector::key_type" ref="ad77b756f443ca3cd938369dd0a5b617c" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef K <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#ad77b756f443ca3cd938369dd0a5b617c">key_type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of vector component/feature uid's in this vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00121">121</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="af1d4a320e7577f785791e5df70391264"></a><!-- doxytag: member="reranker::FeatureVector::mapped_type" ref="af1d4a320e7577f785791e5df70391264" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#af1d4a320e7577f785791e5df70391264">mapped_type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of values/feature weights in this vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00123">123</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a038fac9f5a5d1bcfe98640eff66ba30c"></a><!-- doxytag: member="reranker::FeatureVector::FeatureVector" ref="a038fac9f5a5d1bcfe98640eff66ba30c" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create an empty feature vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00094">94</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a243fcd766c91f24bd79cbb6fb3aabe05"></a><!-- doxytag: member="reranker::FeatureVector::FeatureVector" ref="a243fcd766c91f24bd79cbb6fb3aabe05" args="(const Map &amp;features)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a> </td>
          <td>(</td>
          <td class="paramtype">const Map &amp;&#160;</td>
          <td class="paramname"><em>features</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Copy features from the type of map used internally. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">features</td><td>the map of features with which to initialize this feature vector </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00100">100</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a299eb15548226ffe246a2fcdf78804d6"></a><!-- doxytag: member="reranker::FeatureVector::FeatureVector" ref="a299eb15548226ffe246a2fcdf78804d6" args="(const MapType &amp;features)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
<div class="memtemplate">
template&lt;typename MapType &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a> </td>
          <td>(</td>
          <td class="paramtype">const MapType &amp;&#160;</td>
          <td class="paramname"><em>features</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Copy features from any map, or any collection of (feature,value) pairs, for that matter. </p>
<dl class=""><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">MapType</td><td>the type of map from which to copy features into this feature vector </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">features</td><td>the map or collection of (feature,value) pairs with which to initialize this feature vector </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00110">110</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ae57362e810f7cf109f9c96153c387864"></a><!-- doxytag: member="reranker::FeatureVector::~FeatureVector" ref="ae57362e810f7cf109f9c96153c387864" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::~<a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00117">117</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa732c2a9d4b249b652f881eb57112e1f"></a><!-- doxytag: member="reranker::FeatureVector::AddScaledSubvector" ref="aa732c2a9d4b249b652f881eb57112e1f" args="(const Collection &amp;feature_uids, const FeatureVector&lt; K, V &gt; &amp;feature_vector, V scalar)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
<div class="memtemplate">
template&lt;typename Collection &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt;K,V&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#aa732c2a9d4b249b652f881eb57112e1f">AddScaledSubvector</a> </td>
          <td>(</td>
          <td class="paramtype">const Collection &amp;&#160;</td>
          <td class="paramname"><em>feature_uids</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td>
          <td class="paramname"><em>feature_vector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>scalar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Modifies this vector so that it equals this vector plus the scaled specified subvector. </p>
<p>The specified collection of feature uid's&mdash;the <code>feature_uids</code> parameter&mdash;specifies the subspace into which to project the specified feature vector&mdash;the <code>feature_vector</code> parameter. This subvector is then scaled by the specified scalar&mdash;the <code>scalar</code> parameter&mdash;and added to this vector in situ.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">feature_uids</td><td>the subspace into which to project the specified feature vector before scaling and adding to this vector </td></tr>
    <tr><td class="paramname">feature_vector</td><td>the feature vector to be projected into a subspace, scaled and then added to this vector </td></tr>
    <tr><td class="paramname">scalar</td><td>the amount by which to scale the specified subvector prior to adding it to this vector </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>this vector, having been modified by this method </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00345">345</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a76c6244a176999e72a54c78726ee718f"></a><!-- doxytag: member="reranker::FeatureVector::AddScaledVector" ref="a76c6244a176999e72a54c78726ee718f" args="(const FeatureVector&lt; K, V &gt; &amp;other, V scalar)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt;K,V&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a76c6244a176999e72a54c78726ee718f">AddScaledVector</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td>
          <td class="paramname"><em>other</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>scalar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Modifies this vector so that it equals this vector plus the scaled specified vector. </p>
<p>In notation, if this vector is v1 and the specified vector is v2 and the scalar is a, then after invoking this method this vector would equal v1 + a*v2.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">other</td><td>the vector the scaled version of which is to be added to this vector </td></tr>
    <tr><td class="paramname">scalar</td><td>the amount by which to scale the specified vector before adding the result to this vector </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>this vector, having been modified by this method </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00320">320</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ae0c185e646996daff25fcad9b224eda5"></a><!-- doxytag: member="reranker::FeatureVector::begin" ref="ae0c185e646996daff25fcad9b224eda5" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a> <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#ae0c185e646996daff25fcad9b224eda5">begin</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a const iterator pointing to the first of the feature-value pairs of this feature vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00135">135</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a7082611256f0b6dc90ba4b38cc43e4ab"></a><!-- doxytag: member="reranker::FeatureVector::clear" ref="a7082611256f0b6dc90ba4b38cc43e4ab" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a7082611256f0b6dc90ba4b38cc43e4ab">clear</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets all feature weights to zero and, because this is a sparse vector, clears all storage. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00377">377</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a03929c2f26faf01b1406074943f99b86"></a><!-- doxytag: member="reranker::FeatureVector::Dot" ref="a03929c2f26faf01b1406074943f99b86" args="(const FeatureVector&lt; K, V &gt; &amp;other) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a03929c2f26faf01b1406074943f99b86">Dot</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the dot product of this feature vector with the specified <a class="el" href="classreranker_1_1_feature_vector.html" title="A class to represent a feature vector, where features are represented by unique identifiers, and feature values are represented by the template type.">FeatureVector</a>. </p>
<p>This primitive operation is one out of which a multitude of kernel functions may be constructed. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00219">219</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a72b41f295541c52d9ad4a25e789b7ba4"></a><!-- doxytag: member="reranker::FeatureVector::empty" ref="a72b41f295541c52d9ad4a25e789b7ba4" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a72b41f295541c52d9ad4a25e789b7ba4">empty</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00214">214</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a9f2539faf4e600c2f75b613763d49fcd"></a><!-- doxytag: member="reranker::FeatureVector::end" ref="a9f2539faf4e600c2f75b613763d49fcd" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html#a8dc4093ae778bffb30d2840002f02ba1">const_iterator</a> <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a9f2539faf4e600c2f75b613763d49fcd">end</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a const iterator pointing to the end of the feature-value pairs of this feature vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00141">141</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a87bccd3acb055b98a674e6ed7d29af4b"></a><!-- doxytag: member="reranker::FeatureVector::GetNonZeroFeatures" ref="a87bccd3acb055b98a674e6ed7d29af4b" args="(unordered_set&lt; K &gt; &amp;set) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">unordered_set&lt;K&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a87bccd3acb055b98a674e6ed7d29af4b">GetNonZeroFeatures</a> </td>
          <td>(</td>
          <td class="paramtype">unordered_set&lt; K &gt; &amp;&#160;</td>
          <td class="paramname"><em>set</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Inserts the uid's of features with non-zero weights into the specified set. </p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The specified is <em>not</em> cleared at any time by this method.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">set</td><td>the set in which to insert uid's of all features with non-zero weight </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the specified set, having been modified by this method </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00153">153</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a565133f9b5b31de43d07aea909631be5"></a><!-- doxytag: member="reranker::FeatureVector::GetValue" ref="a565133f9b5b31de43d07aea909631be5" args="(const K &amp;uid) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a565133f9b5b31de43d07aea909631be5">GetValue</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Synonymous with <a class="el" href="classreranker_1_1_feature_vector.html#a0786ae9b9f6b579a80d8ae601edfd80a">GetWeight</a>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uid</td><td>the uid of the feature whose value is to be retrieved </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00207">207</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a0786ae9b9f6b579a80d8ae601edfd80a"></a><!-- doxytag: member="reranker::FeatureVector::GetWeight" ref="a0786ae9b9f6b579a80d8ae601edfd80a" args="(const K &amp;uid) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a0786ae9b9f6b579a80d8ae601edfd80a">GetWeight</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the weight of the feature with the specified uid, where crucially features not "present" in this vector implicitly have a weight of 0.0 (or whatever the default constructor of the value type is). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uid</td><td>the uid of the feature whose weight is to be retrieved </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00199">199</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a2829655419a2dfd5014094e6834836df"></a><!-- doxytag: member="reranker::FeatureVector::IncrementValue" ref="a2829655419a2dfd5014094e6834836df" args="(const K &amp;uid, V by)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a2829655419a2dfd5014094e6834836df">IncrementValue</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>by</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Increments the value of the specified vector component by the specified amount. </p>
<p>(Synonym for <a class="el" href="classreranker_1_1_feature_vector.html#a541f26184a4407f62eb5dad8102cf375">IncrementWeight</a>.)</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uid</td><td>the uid of the vector component whose value is to be incremented </td></tr>
    <tr><td class="paramname">by</td><td>the amount by which to increment the specified component's value </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new value for the specified vector component </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00276">276</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a541f26184a4407f62eb5dad8102cf375"></a><!-- doxytag: member="reranker::FeatureVector::IncrementWeight" ref="a541f26184a4407f62eb5dad8102cf375" args="(const K &amp;uid, V by)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a541f26184a4407f62eb5dad8102cf375">IncrementWeight</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>by</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Increments the weight of the specified feature by the specified amount. </p>
<p>This method is synonymous with <a class="el" href="classreranker_1_1_feature_vector.html#a2829655419a2dfd5014094e6834836df">IncrementValue</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uid</td><td>the uid of the feature whose weight is to be incremented </td></tr>
    <tr><td class="paramname">by</td><td>the amount by which to increment the specified feature's value </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new value for the specified feature </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00241">241</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="afb07b55b5c08d60b2390c20b12ba1a57"></a><!-- doxytag: member="reranker::FeatureVector::IncrementWeights" ref="afb07b55b5c08d60b2390c20b12ba1a57" args="(const Collection &amp;feature_uids, V increment)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
<div class="memtemplate">
template&lt;typename Collection &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt;K,V&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#afb07b55b5c08d60b2390c20b12ba1a57">IncrementWeights</a> </td>
          <td>(</td>
          <td class="paramtype">const Collection &amp;&#160;</td>
          <td class="paramname"><em>feature_uids</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>increment</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Increments the weights for the specified collection of features. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">feature_uids</td><td>a collection of feature uid's whose weights are to be incremented by the specified amount </td></tr>
    <tr><td class="paramname">increment</td><td>the amount by which to increment the weight of the specified set of features </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>this vector, having been modified by this method </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00365">365</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a56cdaf41599879784f9342e6d94250b0"></a><!-- doxytag: member="reranker::FeatureVector::RemoveEqualFeatures" ref="a56cdaf41599879784f9342e6d94250b0" args="(const FeatureVector&lt; K, V &gt; &amp;other, unordered_set&lt; K &gt; &amp;set) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">unordered_set&lt;K&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a56cdaf41599879784f9342e6d94250b0">RemoveEqualFeatures</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td>
          <td class="paramname"><em>other</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unordered_set&lt; K &gt; &amp;&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes from the specified set the uid's of feature with weights equal in this vector to their weights in the specified vector. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>the vector whose feature weights are to be compared to those in this vector </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">set</td><td>the set to be modified by this method </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the specified set having been modified </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00182">182</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ae4e7570b1829aa527fb6a487016437f0"></a><!-- doxytag: member="reranker::FeatureVector::RemoveNonZeroFeatures" ref="ae4e7570b1829aa527fb6a487016437f0" args="(unordered_set&lt; K &gt; &amp;set) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">unordered_set&lt;K&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#ae4e7570b1829aa527fb6a487016437f0">RemoveNonZeroFeatures</a> </td>
          <td>(</td>
          <td class="paramtype">unordered_set&lt; K &gt; &amp;&#160;</td>
          <td class="paramname"><em>set</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Removes the uid's of features with non-zero weights from the specified set. </p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The specified is <em>not</em> cleared at any time by this method.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">set</td><td>the set from which to remove uid's of all features with non-zero weight </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the specified set having been modified </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00168">168</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a0535e2a994950ccd367a47fde39faa98"></a><!-- doxytag: member="reranker::FeatureVector::Scale" ref="a0535e2a994950ccd367a47fde39faa98" args="(V scalar)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt;K,V&gt;&amp; <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a0535e2a994950ccd367a47fde39faa98">Scale</a> </td>
          <td>(</td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>scalar</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Multiplies this vector, in situ, by the specified scalar. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">scalar</td><td>the amount by which to scale this vector </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>this vector, having been modified by this method </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00303">303</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ac0a4fceef14eba9efb471f5ec0476579"></a><!-- doxytag: member="reranker::FeatureVector::SetValue" ref="ac0a4fceef14eba9efb471f5ec0476579" args="(const K &amp;uid, V new_value)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#ac0a4fceef14eba9efb471f5ec0476579">SetValue</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>new_value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Synonym for <a class="el" href="classreranker_1_1_feature_vector.html#ad94d388ef81023981d6924a2020268d2">SetWeight</a>. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00295">295</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="ad94d388ef81023981d6924a2020268d2"></a><!-- doxytag: member="reranker::FeatureVector::SetWeight" ref="ad94d388ef81023981d6924a2020268d2" args="(const K &amp;uid, V new_weight)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#ad94d388ef81023981d6924a2020268d2">SetWeight</a> </td>
          <td>(</td>
          <td class="paramtype">const K &amp;&#160;</td>
          <td class="paramname"><em>uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V&#160;</td>
          <td class="paramname"><em>new_weight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the weight of the specified feature to the specified value. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uid</td><td>the uid of the feature whose weight is to be set </td></tr>
    <tr><td class="paramname">new_weight</td><td>the weight to which to set the specified feature </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the old weight for the specified feature </dd></dl>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00284">284</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<a class="anchor" id="a08a5b65bae6cc0bb35e035e5797a00f2"></a><!-- doxytag: member="reranker::FeatureVector::size" ref="a08a5b65bae6cc0bb35e035e5797a00f2" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="classreranker_1_1_feature_vector.html">reranker::FeatureVector</a>&lt; K, V, Map &gt;::<a class="el" href="classreranker_1_1_feature_vector.html#a08a5b65bae6cc0bb35e035e5797a00f2">size</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the number of non-zero feature components of this feature vector. </p>

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00212">212</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="ab17a2e88eac7592792ebdb62b731426b"></a><!-- doxytag: member="reranker::FeatureVector::operator&lt;&lt;" ref="ab17a2e88eac7592792ebdb62b731426b" args="(ostream &amp;os, const FeatureVector&lt; K, V &gt; &amp;fv)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K, typename V, typename Map = unordered_map&lt;K, V&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">ostream&amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_feature_vector.html">FeatureVector</a>&lt; K, V &gt; &amp;&#160;</td>
          <td class="paramname"><em>fv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="feature-vector_8_h_source.html#l00385">385</a> of file <a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="feature-vector_8_h_source.html">feature-vector.H</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 9 2013 11:56:30 for Reranker Framework (ReFr) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
